<?php
/**
 * Create By: PhpStorm
 * User: niechenguang
 * File: Circle.php
 * Date: 2017/1/2
 * Time: 21:45
 */

namespace app\api\controller;

use app\api\model\page\community\Index as CommunityIndex;

use app\api\model\page\community\Search;
use app\api\model\page\community\SearchCircle;
use think\Request;
use app\library\aliyun\oss\OssWorker;

class Community
{

    private $communityIndexModel;

    protected $param;

    public function __construct()
    {
        $this->param = Request::instance()->param();

        $this->communityIndexModel = new CommunityIndex();
    }

    /**
     * 社区大厅
     *
     * @return array
     */
    public function index()
    {
        return $this->communityIndexModel->excute($this->param);
    }

    /**
     * 社区大厅
     *
     * @return array
     */
    public function search()
    {
        $obj = new Search();
        return $obj->excute($this->param);
    }

    /**
     * 社区大厅
     *
     * @return array
     */
    public function searchCircle()
    {
        $obj = new SearchCircle();
        return $obj->excute($this->param);
    }

    /**
     * 社区大厅
     *
     * @return array
     */
    public function upfile()
    {
        $obj = new OssWorker();
        return $obj->uploadFile('wanyihua', '123.jpg', '/home/work/123.jpg');
    }
}
